<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <title>选择代理用户</title>
  <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
  <link rel="stylesheet" href="/static/include/css/style.css">
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
    <div class="col-sm-12 search-collapse">
      <form id="role-form">
        <div class="select-list">
          <ul>
            <li>
              姓名：<input type="text" name="username^VLK"/>
            </li>
            <li>
              账号：<input type="text" name="loginname^VLK"/>
            </li>
            <li>
              <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
            </li>
          </ul>
        </div>
      </form>
    </div>


    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table"></table>
    </div>
  </div>
</div>
<script src="/static/include/js/footer.js"></script>
<script>
  var userIds;

  function initData(initData) {
    userIds = initData
    initTable()
  }

  function initTable() {
    var options = {
      url: api + '/scabpm/form/formCustDialog/listData_userSelector',
      listType: 'bpm',
      method: 'post',
      columns: [{
        checkbox: true,
        formatter: function (value, row, index) {
          if (userIds.indexOf(row.user_id) >= 0) {
            return {
              checked: true
            }
          }
        }
      },
        {
          field: 'username',
          title: '姓名'
        },
        {
          field: 'loginname',
          title: '账号'
        },
        {
          field: 'phone',
          title: '手机号码'
        }
      ]
    };
    $.table.init(options);
  }
</script>

</body>
</html>